//
//  PublicChangePwdApi.m
//  SampleProject
//
//  Created by ZhangYeKun on 2017/3/8.
//  Copyright © 2017年 Fidetro. All rights reserved.
//

#import "PublicChangePwdApi.h"

@implementation PublicChangePwdApi
{
    NSDictionary *_dic;
}

- (instancetype)initWithDic:(NSDictionary *)dic{
    if (self = [super init]) {
        _dic = dic;
    }
    return self;
}

- (NSString *)requestUrl {
    return @"/user/change_pwd";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}

- (id)requestArgument {
    
    NSMutableDictionary *dic = [NSMutableDictionary getPubdic];
    if (_dic[@"old_pwd"]) {
        
        NSString* base64Text = [NSString encryptUseAES:_dic[@"old_pwd"] key:nil];
        
        [dic setObject:base64Text forKey:@"old_pwd"];
        
    }
    if (_dic[@"new_pwd"]) {
        NSString* base64Text = [NSString encryptUseAES:_dic[@"new_pwd"] key:nil];
        
        [dic setObject:base64Text forKey:@"new_pwd"];
        
    }

    NSString *sign=[NSString getSign:dic];
    [dic setObject:sign forKey:@"sign"];
    
    return dic;
}
@end
